import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

import 'index.dart';

class SplashPage extends StatelessWidget {
  SplashPage({Key? key}) : super(key: key);
  final controller = Get.put(SplashLogic());

  @override
  Widget build(BuildContext context) {
    return GetBuilder<SplashLogic>(
      builder: (_) {
        return Scaffold(
          body: Stack(
            children: [
              Image.asset(
                'assets/images/splash.png',
                height: Get.height,
                width: Get.width,
                fit: BoxFit.cover,
              ),
              Positioned(
                right: 20.r,
                child: SafeArea(
                  child: InkWell(
                    onTap: controller.toMain,
                    child: Container(
                      width: 40.r,
                      height: 40.r,
                      alignment: Alignment.center,
                      decoration: BoxDecoration(
                          color: Colors.grey[350],
                          borderRadius: BorderRadius.circular(20.r)),
                      child: Text(
                        controller.state.seconds.toString(),
                        style: TextStyle(color: Colors.white, fontSize: 13.sp),
                      ),
                    ),
                  ),
                ),
              ),
            ],
          ),
        );
      },
    );
  }
}
